﻿using Microsoft.Xna.Framework;

namespace Firefly.Framework.Collections.Spatial
{
    public abstract class QuadTreeNode : IQuadTreeNode
    {
        #region IQuadTreeNode Members

        public IQuadTreeNode Parent { get; set; }
        public IQuadTreeNode LeftUpNode { get; set; }
        public IQuadTreeNode RightUpNode { get; set; }
        public IQuadTreeNode LeftDownNode { get; set; }
        public IQuadTreeNode RightDownNode { get; set; }
        public IQuadTreeNode UpNode { get; set; }
        public IQuadTreeNode DownNode { get; set; }
        public IQuadTreeNode LeftNode { get; set; }
        public IQuadTreeNode RightNode { get; set; }
        public int NodeDepth { get; protected set; }
        public int NodeLevel { get; protected set; }
        public int NodeScale { get; protected set; }
        public NodeStatus Status { get; set; }
        public BoundingBox BoundingBox { get; protected set; }
        public bool InView { get; set; }
        public float DistanceFromCamera { get; set; }
        public int XPosition { get; protected set; }
        public int YPosition { get; protected set; }
        public virtual Vector3 Offset { get; set; }

        public void Reset()
        {
            Status = NodeStatus.BelowLeaf;
            InView = true;
        }

        #endregion
    }
}
